package com.alibaba.zihao.service;

import java.util.ArrayList;

/**
 * Created by jason on 3/8/15.
 */
public abstract class AbstractSubject implements Subject {

    private ArrayList<Observer> observers = new ArrayList<Observer>();
    public void add(Observer observer){
        observers.add(observer);
    }
    public void del(Observer observer){
        observers.remove(observer);
    }
    public void opr(){
            for(Observer observer:observers){
                observer.operate();
            }
    }
}
